#include <stdio.h>
#include <stdlib.h>

#define SIZE 128
int main(int argc ,char* argv[]){
	FILE* fr=NULL;
	FILE* fw=NULL;
	fw=popen("t.txt","a");
	fr=popen("popen.c","r");
	if(fr==NULL||fw==NULL){
		perror("Failed to open file");
		exit(1);	
	}
	char* ptr[SIZE];
	size_t fr_size=0;
	while( (fr_size=fread(ptr,sizeof(ptr[0]),SIZE,fr))>0){
		fwrite(ptr,sizeof(ptr[0]),fr_size,fw);
	}
	fclose(fw);
	fclose(fr);
	return 0;
}
